<!--
 * @Date: 2020-11-21 00:15:34
 * @LastEditTime: 2020-12-07 00:34:22
 * @FilePath: \web-practice-repo\practice\one\navbar.html
-->
<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]>      <html class="no-js"> <!--<![endif]-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>practice1</title>
    <meta name="description" content="just a practice">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="">
    <style>
        ul {
            list-style-type: none;
            padding: 0;
            margin: 0;
            overflow: hidden;
            text-align: center;
            background-color: black;
        }

        ul li {
            display: inline;
            float: left;
        }

        li a {
            display: block;
            width: 120px;
            height: 32px;
            color: rgb(204, 204, 204);
            text-decoration: none;
            text-align: center;
            padding: 14px 10px;
        }

        li a:hover {
            color: white;
        }

        #s1 {
            background-color: rgb(251, 251, 253);
            width: 100%;
            height: 300px;
        }

        #list1,
        #list2,
        #list3,
        #list4 {
            float: left;
            width: 140px;
            height: 100px;
            border: 1px solid rgb(201, 200, 200);
            padding: 2px;
            background-color: rgb(250, 244, 234);
            opacity: 0;
            transition: opacity 0.6s;
            -moz-transition: opacity 0.6s;
            /* Firefox 4 */
            -webkit-transition: opacity 0.6s;
            /* Safari 和 Chrome */
            -o-transition: opacity 0.6s;
            /* Opera */
        }

        #container {
            width: 1000px;
            height: 1000px;
            position: relative;
            top: 150px;
            background-color: rgb(241, 232, 217);
        }

        #animate1 {
            width: 600px;
            height: 600px;
            position: absolute;
            background-image: url(./myself.png);
            background-size: 100%;
        }

        button {
            color: white;
            background-color: rgb(231, 103, 105);
            height: 50px;
            width: 100px;
            border-radius: 10px;
            font-size: 20px;
        }

        button:hover {
            background-color: brown;
        }
    </style>
</head>

<body>
    <!--[if lt IE 7]>
            <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="#">upgrade your browser</a> to improve your experience.</p>
        <![endif]-->
    <nav id="banner">
        <ul id="menu">
            <li onmouseover="showDiv('list1')" onmouseout="hiddenDiv('list1')">
                <a href="#">朋友们好啊</a>
            </li>
            <li onmouseover="showDiv('list2')" onmouseout="hiddenDiv('list2')">
                <a href="#">我是</a>
            </li>
            <li onmouseover="showDiv('list3')" onmouseout="hiddenDiv('list3')">
                <a href="#">联系</a>
            </li>
            <li onmouseover="showDiv('list4')" onmouseout="hiddenDiv('list4')">
                <a href="#">关于</a>
            </li>
            <li style="float: right;">
                <a href="">别点我！</a>
            </li>
        </ul>
    </nav>
    <div id="list1">
        <p>我叫:</p>
        <p>龚坤</p>
    </div>
    <div id="list2">
        <p>代码乱敲派</p>
        <p>掌门人</p>
    </div>
    <div id="list3">
        <p>qq:</p>
        <p>2582355704</p>
    </div>
    <div id="list4">
        <p>我实在</p>
        <p>想不出文案了这件事</p>
    </div>
    <section class="s1">
        <button type="button" onclick="moveMe()">点我!</button>
    </section>
    <div id="container">
        <div id="animate1"></div>
    </div>
    <script>
        function showDiv(id) {
            document.getElementById(id).style.opacity = "1";
        }

        function hiddenDiv(id) {
            document.getElementById(id).style.opacity = "0";
        }

        function moveMe() {
            var item1 = document.getElementById("animate1");
            pos1 = 0;
            var id = setInterval(frame, 5);

            function frame() {
                if (pos1 == 150) {
                    clearInterval(id);
                } else {
                    pos1++;
                    item1.style.top = pos1 + "px";
                    item1.style.left = pos1 + "px";
                }
            }
        }
    </script>
</body>

</html>